package com.cn.zengzeng.spbzengzeng.config;

import com.github.benmanes.caffeine.cache.Cache;
import com.github.benmanes.caffeine.cache.Caffeine;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.TimeUnit;


/**
 * 本地缓存配置
 * @Author: ZhangZengZeng
 * @Date: 2022/5/27 16:08
 */
@Configuration
public class ICacheConfig {
    @Bean
    public Cache<String,Object> getCache () {
        return Caffeine.newBuilder().expireAfterWrite(10,TimeUnit.MINUTES).maximumSize(10024).build();
    }
}
